<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>父级百分比</title>
    <style>
      html {
        height: 100%;
      }

      body {
        height: 100%;
      }

      .box {
        background-color: pink;
        /* % 是相对于父级的百分比 */
        width: 50%;
        height: 50%;
      }
    </style>
  </head>
  <body>
    <div class="box">盒子</div>
  </body>
</html>
